Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error propagation #82

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Fix error propagation #82

merged 1 commit into from
Nov 14, 2024

Conversation

marcospassos
Copy link
Member

Summary

Next.js uses an exception-based mechanism to determine whether a route is dynamic. For instance, when cookies or headers are accessed within a static route, a DynamicServerError is triggered, which disables static generation for that route.

However, since this error is currently being caught for error reporting purposes, Next.js fails to detect dynamic hook usage correctly, resulting in a build failure.

This PR addresses the issue by allowing these errors to propagate up the call stack, enabling accurate detection of dynamic hooks and ensuring the build process succeeds.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@marcospassos marcospassos added the enhancement New feature or request label Nov 14, 2024
Copy link

pkg-pr-new bot commented Nov 14, 2024

Open in Stackblitz

npm i https://pkg.pr.new/@croct/plug-next@82

commit: f7020ad

@marcospassos marcospassos merged commit 6b82abd into master Nov 14, 2024
8 checks passed
@marcospassos marcospassos deleted the fix-error-propagation branch November 14, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant